# Maintainer:  Caleb Maclennan <caleb@alerque.com>
# Contributor: Jordi De Groof <jordi.degroof@gmail.com>
# Contributor: Andre Klitzing <aklitzing@gmail.com>

pkgname=lcov
pkgver=1.16
pkgrel=1
pkgdesc='front-end for GCC’s coverage testing tool gcov'
arch=(any)
url="https://github.com/linux-test-project/$pkgname"
license=(GPL)
depends=(perl)
backup=(etc/lcovrc)
_archive="$pkgname-$pkgver"
source=("$url/releases/download/v$pkgver/$_archive.tar.gz"
        handle-equals-signs.patch
        fix-undef-behaviour.patch)
sha256sums=('987031ad5528c8a746d4b52b380bc1bffe412de1f2b9c2ba5224995668e3240b'
            '54728aa4e244d3662c65ba91fb486dc1d5c64d9d55745ee334c4131109dc233c'
            'ceaf41f7cc9cea5a6fc4b0385ffef10d1ab8812acd2a5b16dcd8d7bca7120488')

prepare() {
    cd "$_archive"
    patch -p1 -i ../handle-equals-signs.patch
    patch -p1 -i ../fix-undef-behaviour.patch
}

package () {
    cd "$_archive"
    make PREFIX="/usr" CFG_DIR=/etc DESTDIR="$pkgdir" install
}

